<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 如果盒子本身没有width/height属性，则此时padding不会程开盒子大小 */
        h1 {
            height: 200px;
            background-color: pink;
            padding:30px
        }
        div{
            width: 300px;
            height: 100px;
            background-color: plum;
        }
        div p{
            padding:30px;
            background-color: skyblue;
        }
    </style>
</head>

<body>
    <h1></h1>
    <div><P></P></div>
</body>

</html>